package com.example.project.mapper;

import com.example.project.dto.CarItem;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;


@Mapper
public interface ShopcarMapper {

    //1. 添加到购物车
    public int addCar(int userid,int goodItemid);
    //2. 添加用户购物车商品项
    public int addGoodItem(int userid,int goodid,int num);
    //3. 获取最新添加的购物车商品项id，方便添加到购物车
    public int getGoodItemId(int userid,int goodid);
    //4. 获取用户的购物车数据
    public List<CarItem> getCar(int userid);
    void appendNum(int num,int userid, int goodid);

    Integer getGoodItemIdBygoodId(int userid, int goodid);

    void clearCar(Integer userId);

    void clearCarItem(Integer userId);
}
